<?php

class CSVparse {

    var $mappings = array();

    function buildStock($File) {
        $handle = fopen($File, "r");
        $fields = fgetcsv($handle, 1000, ";");

        while ($data = fgetcsv($handle, 1000, ";")) {
            $detail[] = $data;
        }

        $x = 0;
        $y = 0;

        foreach ($detail as $i) {
            foreach ($fields as $z) {
                $stock[$x][$z] = $i[$y];
                $y++;
            }
            $y = 0;
            $x++;
        }
        return $stock;
    }

}

?>
